import React from "react";

type WindowProps = {
  top: number;
  left: number;
  bottom: number;
  right: number;
  backgroundImage?: string; // 可选背景图
  children?: React.ReactNode;
};

const Window = ({ top, left, bottom, right, backgroundImage, children }: WindowProps) => {
  const style = {
    position: "absolute" as "absolute",
    top: `${top}px`,
    left: `${left}px`,
    width: `calc(100vw - ${left + right}px)`,
    height: `calc(100vh - ${top + bottom}px)`,
    border: "1px solid #ccc",
    backgroundColor: backgroundImage ? `url(${backgroundImage})` : "#fff",
    backgroundSize: "cover",
    backgroundPosition: "center",
    boxShadow: "0 4px 8px rgba(0, 0, 0, 0.1)",
    overflow: "hidden",
  };

  return <div style={style}>{children}</div>;
};

export default Window;